| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkWinUi::TreeView::Item Class Reference

Holds information of a tree view item. More...

## Public Member Functions
| Item () noexcept
virtual | ~Item ()
Item * | addChild (Item *child)
Item * | getChild (unsigned int index) const
unsigned int | getChildCount () const
bool | isParent () const
void | disavowChild (Item *child)
void | setText (nkMemory::StringView text)
void | setIcon (Image *image)
nkMemory::StringView | getText () const
Image * | getIcon () const
void | setParentTree (TreeView *parent)
TreeView * | getParentTree () const
void | setParentItem (Item *item)
Item * | getParentItem () const
void | setAttachedData (void *data)
void * | getAttachedData () const
bool | getCollapsed () const
virtual void | setCollapsed (bool value)
void | exportIntrospection (nkExport::Node *rootNode)

## Detailed Description

Holds information of a tree view item.

## Constructor & Destructor Documentation

## ◆ Item()

nkWinUi::TreeView::Item::Item | ( |  | ) |
| noexcept

Constructor.

## ◆ ~Item()

virtual nkWinUi::TreeView::Item::~Item | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ addChild()

Item* nkWinUi::TreeView::Item::addChild | ( | Item * | child | ) |

Adds a child item.

Parameters

  child | The item to add as a child.

Returns
  The item provided.

## ◆ getChild()

Item* nkWinUi::TreeView::Item::getChild | ( | unsigned int | index | ) | const

Parameters

  index | The index of the item wanted.

Returns
  The child associated to given index if available, nullptr else.

## ◆ getChildCount()

unsigned int nkWinUi::TreeView::Item::getChildCount | ( |  | ) | const

Returns
  The number of children items available.

## ◆ isParent()

bool nkWinUi::TreeView::Item::isParent | ( |  | ) | const

Returns
  Whether the item has at least oen child (true) or not (false).

## ◆ disavowChild()

void nkWinUi::TreeView::Item::disavowChild | ( | Item * | child | ) |

Makes the item forget about a child.

Parameters

  child | The item to forget.

## ◆ setText()

void nkWinUi::TreeView::Item::setText | ( | nkMemory::StringView | text | ) |

Sets the text displayed for the item.

Parameters

  text | The text to show.

## ◆ setIcon()

void nkWinUi::TreeView::Item::setIcon | ( | Image * | image | ) |

Sets the icon to use at the front of the item's line.

Parameters

  image | The image to use.

## ◆ getText()

nkMemory::StringView nkWinUi::TreeView::Item::getText | ( |  | ) | const

Returns
  Currently displayed text.

## ◆ getIcon()

Image* nkWinUi::TreeView::Item::getIcon | ( |  | ) | const

Returns
  The image used as its icon by the item.

## ◆ setParentTree()

void nkWinUi::TreeView::Item::setParentTree | ( | TreeView * | parent | ) |

Sets the parent tree view.

Parameters

  parent | The parent window to set.

## ◆ getParentTree()

TreeView* nkWinUi::TreeView::Item::getParentTree | ( |  | ) | const

Returns
  The parent tree view.

## ◆ setParentItem()

void nkWinUi::TreeView::Item::setParentItem | ( | Item * | item | ) |

Sets the parent item, if any.

Parameters

  item | The parent item to set.

## ◆ getParentItem()

Item* nkWinUi::TreeView::Item::getParentItem | ( |  | ) | const

Returns
  The current parent item.

## ◆ setAttachedData()

void nkWinUi::TreeView::Item::setAttachedData | ( | void * | data | ) |

Sets user data attached to the item.

Parameters

  data | The data to attach.

Remarks
  The item does not own the user data attached.

## ◆ getAttachedData()

void* nkWinUi::TreeView::Item::getAttachedData | ( |  | ) | const

Returns
  Currently attached user data.

## ◆ getCollapsed()

bool nkWinUi::TreeView::Item::getCollapsed | ( |  | ) | const

Returns
  Whether the item is collapsed (true) or not (false).

## ◆ setCollapsed()

virtual void nkWinUi::TreeView::Item::setCollapsed | ( | bool | value | ) |
| virtual

Sets whether an item should be collapsed or not. A collapsed item will hide its descending hierarchy from the view, if any.

Parameters

  value | Whether the item should be collapsed (true) or not (false).

## ◆ exportIntrospection()

void nkWinUi::TreeView::Item::exportIntrospection | ( | nkExport::Node * | rootNode | ) |

Basic export capabilities.

Parameters

  rootNode | The tree to export into.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsWinUi/Components/TreeView.h